package com.movie.service.impl;

import com.movie.dao.MovieMapper;
import com.movie.model.Movie;
import com.movie.service.MovieService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MovieServiceImpl implements MovieService {

    @Autowired
    private MovieMapper movieMapper;

    @Override
    public List<Movie> getAllMovies() {
        return movieMapper.getAllMovies();
    }

    @Override
    public Movie getMovieById(Integer id) {
        return movieMapper.getMovieById(id);
    }

    @Override
    public void addMovie(Movie movie) {
        movieMapper.addMovie(movie);
    }

    @Override
    public void updateMovie(Movie movie) {
        movieMapper.updateMovie(movie);
    }

    @Override
    public void deleteMovie(Integer id) {
        movieMapper.deleteMovie(id);
    }
}